﻿<%@ Page Language="C#" AutoEventWireup="false" Inherits="Web.BasePage"%>
<%@ Import Namespace="System.Collections.Generic" %>
<%@ Import Namespace="MAF.Common" %>
<%@ Import Namespace="Web.Controller" %>
<%@ Import Namespace="Domain.Entities" %>
<%@ Import Namespace="Web" %>
<%@ Import Namespace="Web.UI" %>

<% if( SecurityUI.IsMaintainMode(null) ){ %>
    <a href="Part.aspx?Module=<%=Module %>&Handler=Product&Action=New" class="btn-add-product">添加产品</a>
<%} %>

<ul class="clearfix">
<% 
    PageInfo page;
    ProductHandler h = new ProductHandler();
    IList<ProductInfo> list = h.Index(out page);

    foreach (ProductInfo info in list)
    {
%>
    <li>
        <input type="checkbox" name="Id" value="<%=info.Id %>" />
        <%= info.Name %>
        <a href="Default.aspx?Module=<%=Module %>&Handler=Product&Action=Show&Id=<%=info.Id %>">展示</a>
        <% if( SecurityUI.IsMaintainMode(null) ){ %>
        <a href="Part.aspx?Module=<%=Module %>&Handler=Product&Action=Edit&Id=<%=info.Id %>" class="btn-update-product">编辑</a>
        <a href="Part.aspx?Module=<%=Module %>&Handler=Product&Action=Delete&Id=<%=info.Id %>" class="btn-delete-product">删除</a>
        <%} %>
    </li>
<% 
    }
%>
</ul>

<div class="green-black ">
<%
    // 分页导航条
    if (null != page)
    {
        WebPageNavigator nav = new WebPageNavigator(page, Request.QueryString);
        Response.Write(nav.ToString());
    }
%>
</div>